package com.example.a_app;

import android.content.Context;
import android.content.SharedPreferences;

public class Student {
    private String name;
    private String sex;
    private String minzu;
    private String id;
    private String add;

    private  static  final  String SHARED_NAME="userInfo";
    SharedPreferences sharedPreferences;


    public  void save(Context context){
        sharedPreferences = context.getSharedPreferences(SHARED_NAME, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString("name",name);
        editor.putString("sex",sex);
        editor.putString("minzu",minzu);
        editor.putString("id",id);
        editor.putString("add",add);
        editor.commit();
    }

    public Student() {
    }

    public Student(String name, String sex, String minzu, String id, String add) {
        this.name = name;
        this.sex = sex;
        this.minzu = minzu;
        this.id = id;
        this.add = add;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getMinzu() {
        return minzu;
    }

    public void setMinzu(String minzu) {
        this.minzu = minzu;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAdd() {
        return add;
    }

    public void setAdd(String add) {
        this.add = add;
    }
}
